val langsAndAuthors = mapOf("javaScript" to "A","java" to "B", "python" to "C")
println(langsAndAuthors)

class Node(val name:String){
    var attributes:Map<String,String> = mutableMapOf()
    var children: List<Node> = listOf()
    var textValue:String = ""
    fun text(value:String){
        textValue = value
    }
    fun element(childName:String,vararg attributeValues:Pair<String,String>,
                 block:Node.()->Unit):Node{
                    val child = Node(childName)
                    attributeValues.forEach(child.attributes += it)
                    children += child
                }
                return child.apply(block)
    fun toString(indent:Int):String{
        
    }
}

class XMLBuilder {
    fun root(rootElementName:String,block:Node.()->Unit):Node{
        Node(rootElementName).apply(block)
    }
}
fun xml(block:XMLBuilder.()->Node):Node = XMLBuilder().run(block)